/**
 *
 * Controller dell'MVC della schermata Principlae
 * @author Davide
 *
 * @version $Revision: 1.0 $
 */
package it.magazzinoCofi.controllers;

import it.magazzinoCofi.model.DataUserModel;
import it.magazzinoCofi.view.SchermataPrincipale;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import Data.Utente;


/**
 * @author Davide
 * @version $Revision: 1.0 $
 */
public class SchermataPrincipaleController extends AbstractController{
    
    /**
     * Constructor for SchermataPrincipaleController.
     * @param model SchermataPrincipaleModel
     * @param view SchermataPrincipaleView
     */
    SchermataPrincipaleController(DataUserModel model, SchermataPrincipale view) {
        super(model,view);
        
        ((SchermataPrincipale)getM_view()).addPasswordModificationListener(new PasswordModificationListener());
        ((SchermataPrincipale)getM_view()).addInsertListener(new InsertListener());
    }
    
    /**
     * @author Davide
     */
    class PasswordModificationListener implements ActionListener {
        /**
         * Method actionPerformed.
         * @param e ActionEvent
        
         * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */
        public void actionPerformed(ActionEvent e) {
        	System.out.println("[CONTROLLER] Verify action received");
            String userName = "";
            String userPass = "";
           
            	/**
            	 * Prendo l'utente dall'utente
            	 */
                userName = Utente.getInstance().getUser();
                /**
                 * APRO IL JFRAME MODIFICA PASSWORD
                 */
                
                
        }
    }
    
    /**
     * @author Davide
     */
    class InsertListener implements ActionListener{
		/**
		 * Method actionPerformed.
		 * @param arg0 ActionEvent
		
		 * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */
		@Override
		public void actionPerformed(ActionEvent arg0) {
		System.out.println("[CONTROLLER] Verify action received");
		
		/**
		 * APRO IL JFRAME INSERIMENTO COMMESSE
		 */

		
		}
    	
    }
    
}
